/*
 * @Author: czy
 * @Date: 2021-07-11 20:53:58
 * @LastEditTime: 2021-07-15 19:29:48
 */
#ifndef __TYPE_H_
#define __TYPE_H_

#include "sys/container.h"
#include "sys/config.h"
#include "sys/const.h"

typedef signed short int int16;
typedef struct
{
    unsigned int head;
    unsigned int meta;
} Partition;
typedef struct
{
    unsigned int size;
    unsigned int previous;
    unsigned int next;
} Block;
typedef struct
{
    int counter;
    int cycle;
    int times;
    int tskId;
    void (*func)(void);
} hook;
typedef struct
{
    char name[NAME_SIZE];
    char help_content[HELP_SIZE];
    int (*func)(int argc, char *argv[]);
} command;
typedef struct
{
    char data[HIS_SIZE];
} his;
typedef struct
{
    // PC
    unsigned int PC;
    // memory
    unsigned int stack;
    unsigned int reg[6];
    unsigned int heap;

    // pid
    unsigned int pid;
    // state
    int state;
    // priority
    unsigned int priority;
    unsigned int total_run_time;
    unsigned int last_run_time;
    unsigned int running_times;
} PCB;

#endif